import request from '@/config/axios'

export interface BaseInfoVO {
  id: number
  htid: string
  htmc: string
  htlx: string
  htlb: string
  ewm: string
  htje: number
  kssj: Date
  jssj: Date
  xmmc: string
  bm: string
  fzr: string
  zxfs: string
  zynr: string
  fkfs: string
  khdw: string
  khlxr: string
  htzt: string
  bz: string
  qdsj: Date
  xid: string
  jrdd: string
  scdd: string
}

// 查询合同基础信息表 分页
export const getBaseInfoPage = async (params) => {
  return await request.get({ url: `/cont/base-info/page`, params })
}

// 查询合同基础信息表 详情
export const getBaseInfo = async (id: number) => {
  return await request.get({ url: `/cont/base-info/get?id=` + id })
}

// 新增合同基础信息表 
export const createBaseInfo = async (data: BaseInfoVO) => {
  return await request.post({ url: `/cont/base-info/create`, data })
}

// 修改合同基础信息表 
export const updateBaseInfo = async (data: BaseInfoVO) => {
  return await request.put({ url: `/cont/base-info/update`, data })
}

// 删除合同基础信息表 
export const deleteBaseInfo = async (id: number) => {
  return await request.delete({ url: `/cont/base-info/delete?id=` + id })
}

// 导出合同基础信息表  Excel
export const exportBaseInfo = async (params) => {
  return await request.download({ url: `/cont/base-info/export-excel`, params })
}

// ==================== 子表（建设合同详细信息） ====================

// 获得建设合同详细信息分页
export const getDetailInfoPage = async (params) => {
  return await request.get({ url: `/cont/base-info/detail-info/page`, params })
}
// 新增建设合同详细信息
export const createDetailInfo = async (data) => {
  return await request.post({ url: `/cont/base-info/detail-info/create`, data })
}

// 修改建设合同详细信息
export const updateDetailInfo = async (data) => {
  return await request.put({ url: `/cont/base-info/detail-info/update`, data })
}

// 删除建设合同详细信息
export const deleteDetailInfo = async (id: number) => {
  return await request.delete({ url: `/cont/base-info/detail-info/delete?id=` + id })
}

// 获得建设合同详细信息
export const getDetailInfo = async (id: number) => {
  return await request.get({ url: `/cont/base-info/detail-info/get?id=` + id })
}

// ==================== 子表（合同资料表 ） ====================

// 获得合同资料表 分页
export const getMaterialInfoPage = async (params) => {
  return await request.get({ url: `/cont/base-info/material-info/page`, params })
}
// 新增合同资料表 
export const createMaterialInfo = async (data) => {
  return await request.post({ url: `/cont/base-info/material-info/create`, data })
}

// 修改合同资料表 
export const updateMaterialInfo = async (data) => {
  return await request.put({ url: `/cont/base-info/material-info/update`, data })
}

// 删除合同资料表 
export const deleteMaterialInfo = async (id: number) => {
  return await request.delete({ url: `/cont/base-info/material-info/delete?id=` + id })
}

// 获得合同资料表 
export const getMaterialInfo = async (id: number) => {
  return await request.get({ url: `/cont/base-info/material-info/get?id=` + id })
}

// ==================== 子表（合同收付款记录表 ） ====================

// 获得合同收付款记录表 分页
export const getPayInfoPage = async (params) => {
  return await request.get({ url: `/cont/base-info/pay-info/page`, params })
}
// 新增合同收付款记录表 
export const createPayInfo = async (data) => {
  return await request.post({ url: `/cont/base-info/pay-info/create`, data })
}

// 修改合同收付款记录表 
export const updatePayInfo = async (data) => {
  return await request.put({ url: `/cont/base-info/pay-info/update`, data })
}

// 删除合同收付款记录表 
export const deletePayInfo = async (id: number) => {
  return await request.delete({ url: `/cont/base-info/pay-info/delete?id=` + id })
}

// 获得合同收付款记录表 
export const getPayInfo = async (id: number) => {
  return await request.get({ url: `/cont/base-info/pay-info/get?id=` + id })
}

// ==================== 子表（合同变更记录表 ） ====================

// 获得合同变更记录表 分页
export const getChangeInfoPage = async (params) => {
  return await request.get({ url: `/cont/base-info/change-info/page`, params })
}
// 新增合同变更记录表 
export const createChangeInfo = async (data) => {
  return await request.post({ url: `/cont/base-info/change-info/create`, data })
}

// 修改合同变更记录表 
export const updateChangeInfo = async (data) => {
  return await request.put({ url: `/cont/base-info/change-info/update`, data })
}

// 删除合同变更记录表 
export const deleteChangeInfo = async (id: number) => {
  return await request.delete({ url: `/cont/base-info/change-info/delete?id=` + id })
}

// 获得合同变更记录表 
export const getChangeInfo = async (id: number) => {
  return await request.get({ url: `/cont/base-info/change-info/get?id=` + id })
}

// ==================== 子表（合同收付款计划表 ） ====================

// 获得合同收付款计划表 分页
export const getPlanInfoPage = async (params) => {
  return await request.get({ url: `/cont/base-info/plan-info/page`, params })
}
// 新增合同收付款计划表 
export const createPlanInfo = async (data) => {
  return await request.post({ url: `/cont/base-info/plan-info/create`, data })
}

// 修改合同收付款计划表 
export const updatePlanInfo = async (data) => {
  return await request.put({ url: `/cont/base-info/plan-info/update`, data })
}

// 删除合同收付款计划表 
export const deletePlanInfo = async (id: number) => {
  return await request.delete({ url: `/cont/base-info/plan-info/delete?id=` + id })
}

// 获得合同收付款计划表 
export const getPlanInfo = async (id: number) => {
  return await request.get({ url: `/cont/base-info/plan-info/get?id=` + id })
}